package com.managertrade.service.impl;

import com.managertrade.dao.sqlite.entity.StrategyConfig;
import com.managertrade.dao.sqlite.repository.StrategyConfigRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class StrategyConfigService {
    @Autowired
     StrategyConfigRepository repository;



    public StrategyConfig save(StrategyConfig config) {
        return repository.save(config);
    }

    public List<StrategyConfig> list() {
        return repository.findAll();
    }


    public void delete(Long id) {
        repository.deleteById(id);
    }

    public StrategyConfig findById(Long strategyId) {
        return repository.findById(strategyId).get();
    }
}
